package com.example.thread;

public class MyThread implements Runnable{
    private  int ticket = 1000;

    @Override
    public void run(){

        for(int i=0; i<10000; i++){
            if(this.ticket >0) {
                System.out.println(Thread.currentThread().getName() + " 剩余票数 ：" + this.ticket);
                ticket --;
            }
        }

    }
}
